package com.itheima.domain;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

@Component
public class User {

    private String username;

    public String getUsername(){
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }
@Value("18")
    private int age;
    @Autowired
    private Address address;

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public Address getAddress() {
        return address;
    }

    public void setAddress(Address address) {
        this.address = address;
    }

    @PostConstruct
    public void init(){}

    @PreDestroy
    public void init1(){}
}
